package com.bidepan.spring6.xmltx.controller;

import com.bidepan.spring6.xmltx.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class BookController {
    @Autowired
    private BookService bookService;

    //买书：传入图书id和用户id
    public void buyBook(Integer bookId,Integer userId){
        //调用service中的方法
        try {
            bookService.buyBook(bookId,userId);
        }
        catch (Exception e) {
            System.out.println(e.getMessage());
        }

    }
}
